﻿// =================================================================== 
// 项目说明
//====================================================================
// sushee @Copy Right 2019
// 文件： SmsBlackDayRepository.cs
// 项目名称：斑马车务
// 创建时间：2019/9/19
// 负责人：sushee
// ===================================================================
using System;
using System.Text;
using System.Collections.Generic;
using YouWei.Infrastructure.Entity;
using YouWei.Infrastructure.Models;
using Dapper.Extensions;
using Dapper;

namespace YouWei.Infrastructure.Repository
{
	/// <summary>
	///短信发送黑名单日期 仓储层
	/// </summary>	
	public class SmsBlackDayRepository:BaseRepository<SmsBlackDay>
	{		
    
        #region 构造

        public SmsBlackDayRepository() : base(){}

        public SmsBlackDayRepository(string connectionString) : base(connectionString){}

        public SmsBlackDayRepository(DatabaseContext dbContext) : base(dbContext){}

        #endregion

        /// <summary>
        /// 分页查询
        /// </summary>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <returns></returns>
        public Page<SmsBlackDayDto> GetPages(int pageIndex, long pageSize, int taskId)
        {
            string sql = "SELECT * FROM SmsBlackDay WITH(NOLOCK) where TaskID=@TaskID";
            DynamicParameters dparams = new DynamicParameters();
            dparams.Add("@TaskID", taskId, System.Data.DbType.Int32);
            return dbContext.Connection.Page<SmsBlackDayDto>(pageIndex, pageSize, sql, dparams);
        }
    }
}